<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/

//Route::get('/', function () {
//    return view('welcome');
//});


Route::group([], function () {
    Route::get('/', ['as' => 'index', function () {
            return view("mofa.index");
    }]);
    //案例
    Route::get('/case', ['as'=>'case' ,function () {

            return view("mofa.case");
    }]);
    //加盟
    Route::get('/cooperation', ['as'=>'cooperation' ,function () {
            return view("mofa.cooperation");

    }]);

    //视频专区
    Route::get('/video', ['as'=>'video' ,function () {
            return view("mofa.video");
    }]);

    //新闻
    Route::get('/news', ['as'=>'news' ,function () {
        return view("version-2017.news");
    }]);
    //企业动态
    Route::get('/dynamic', ['as'=>'dynamic' ,function () {
            return view("mofa.dynamic");
    }]);
    //关于
    Route::get('/about', [ 'as'=>'about' ,function () {
            return view("mofa.about");
    }]);


    //产品 智能AR美发系统
    Route::get('/production-optometry', [ 'as'=>'production-optometry' ,function () {
            return view("mofa.production-optometry");
    }]);
//    //产品 自动售货机
//    Route::get('/production-vending', [ 'as'=>'production-vending' ,function () {
//        return view("version-2017.production-vending");
//    }]);
//    //产品 试戴一体机
//    Route::get('/production-try-on', [ 'as'=>'production-try-on' ,function () {
//        return view("version-2017.production-try-on");
//    }]);
//    //产品 pad开店宝
//    Route::get('/production-pad', [ 'as'=>'production-pad' ,function () {
//        return view("version-2017.production-pad");
//    }]);
//    //产品 互动娱乐
//    Route::get('/production-interactive', [ 'as'=>'production-interactive' ,function () {
//        return view("version-2017.production-interactive");
//    }]);
//    //产品 微信商城
//    Route::get('/production-wechat', [ 'as'=>'production-wechat' ,function () {
//        return view("version-2017.production-wechat");
//    }]);


    //服务 AR发型试戴接入服务
    Route::get('/service-try-on', [ 'as'=>'service-try-on' ,function () {

            return view("mofa.service-try-on");


    }]);
    //服务 2D发型虚拟试戴服务
    Route::get('/2D-virtual-try-on', [ 'as'=>'2D-virtual-try-on' ,function () {
        return view("mofa.2D-virtual-try-on");
    }]);

//    // 免费体验 满天星验光配镜智能系统
//    Route::get('/experience-optometry', [ 'as'=>'experience-optometry' ,function () {
//        return view("version-2017.experience-optometry");
//    }]);
//    // 免费体验 2.2.5D眼镜试戴
//    Route::get('/experience-try-on', [ 'as'=>'experience-try-on' ,function () {
//        return view("version-2017.experience-try-on");
//    }]);


    //新闻详情
    Route::get('/news/detail/{articleId}',['as'=>'news-detail',function($articleId){
        return view("mofa.news-detail",['articleId'=>$articleId]);
    }]);

    //免费体验
    Route::get('/free-experience', [ 'as'=>'free-experience' ,function () {
        return view("mofa.free-experience");
    }]);

});




Route::get('admin-web/login', ['as'=>'web-login','uses'=>'Auth\WebAuthController@webLogin']);
Route::post('admin-web/login', ['as'=>'web-login','uses'=>'Auth\WebAuthController@webLoginPost']);
Route::get('web-logout', ['as'=>'web-logout','uses'=>'Auth\WebAuthController@webLogout']);

Route::get('bym_news','WebPage\ArticleController@articleList');
Route::get('bym_article/{id}','WebPage\ArticleController@articleDetail');

//        Route::any('admin-web/login',['as'=>'web-login','uses'=>'Admin\WebController@webLogin']);
//        Route::get('web-logout', ['as'=>'web-logout','uses'=>'Admin\WebController@webLogout']);

Route::get('admin/index',['as'=>'web-home','uses'=>'Admin\HomeController@webIndex']);

Route::group(['prefix'=>'admin','namespace'=>'WebPage\Admin','middleware'=>['auth:web-admin']],function () {  //魔发后台

    /**
     * @see \App\Http\Controllers\WebPage\Admin\ArticleController
     */
    Route::resource('news/edit_news','ArticleController');

    Route::resource('news/type-tag','ArticleTypeController');

    Route::resource('video/web-video','VideoController');

    Route::resource('feedback','FeedbackController');

    Route::post('news/article/uploadimg','ArticleController@uploadArticleImg');

});


Route::get('/product', function () {
    return view('product');
});